function  Sample_fit_tables(sim_mom,data_mom,fp)

cd(fp.paper)

%%%%%%%%%%%%%%%%%%%%;
% Table D-1 (PS);
%%%%%%%%%%%%%%%%%%%%;

label_param=cell(2,1);
label_param{1}=uint16('Child`s Skills');
label_param{2}=uint16('Peers Skills');
label_param{3}=uint16('Authoritarian');


FID = fopen('Table_Fit1.tex', 'w');
fprintf(FID, '\\begin{tabular}{lcc}\\hline \\hline  \n');
fprintf(FID, ' & \\multicolumn{2}{c}{Authoritarian} \\\\ \\cline{2-3} \n');
fprintf(FID, '   &  (1) & (2)  \\\\ \n ');
fprintf(FID, '   &  Model & Data  \\\\ \\hline \\\\ \n ');

ind_label = 1;
for i = 2:3

    fprintf(FID, '%s & %1.3f  & %1.3f  \\\\ \n', ...
        char(label_param{ind_label}),  sim_mom(i) , data_mom(i)  );

    ind_label = ind_label + 1;

end
fprintf(FID, ' \\hline \\\\ \n ');
fprintf(FID, '%s & %1.3f  & %1.3f  \\\\ \n', ...
    'Fraction Authoritarian Parents',  sim_mom(1) , data_mom(1)  );

fprintf(FID, '%s & %s  & %s  \\\\ \n', ...
    'Fraction Authoritarian Parents (by Neighborhood):',  "" , ""  );


fprintf(FID, '%s & %1.3f  & %1.3f  \\\\ \n', ...
    'Neighborhood 1',  sim_mom(33) , data_mom(33)  );

fprintf(FID, '%s & %1.3f  & %1.3f  \\\\ \n', ...
    'Neighborhood 2',  sim_mom(34) , data_mom(34)  );

fprintf(FID, '%s & %1.3f  & %1.3f  \\\\ \n', ...
    'Neighborhood 3',  sim_mom(35) , data_mom(35)  );

fprintf(FID, '%s & %1.3f  & %1.3f  \\\\ \n', ...
    'Neighborhood 4',  sim_mom(36) , data_mom(36)  );


fprintf(FID, '  \\hline \\hline \n');
fprintf(FID, '\\end{tabular}\n');
fclose(FID);


%%%%%%%%%%%%%%%%%%%%;
%Table D-2 (Next-Period Skills);
%%%%%%%%%%%%%%%%%%%%;

FID = fopen('Table_Fit2.tex', 'w');
fprintf(FID, '\\begin{tabular}{lcc cc cc }\\hline \\hline  \n');
fprintf(FID, ' & \\multicolumn{6}{c}{Next-Period Skills} \\\\  & \\multicolumn{2}{c}{ Pooled Sample }  &   \\multicolumn{2}{c}{ Authoritarian = 0 }  & \\multicolumn{2}{c}{ Authoritarian = 1 }  \\\\ \\cline{2-3} \\cline{4-5} \\cline{6-7} \\\\ \n');
fprintf(FID, '   &  (1) & (2)  &  (3) & (4) &  (5) & (6) \\\\ \n ');
fprintf(FID, '   &  Model & Data &  Model & Data &  Model & Data \\\\ \\hline \\\\ \n ');

ind_label = 1;

for i = 4:6

    if i < 6
        fprintf(FID, '%s & %1.3f  & %1.3f & %1.3f  & %1.3f & %1.3f  & %1.3f \\\\ \n', ...
            char(label_param{ind_label}),  sim_mom(i) , data_mom(i) , sim_mom(i+3) , data_mom(i+3) ,  sim_mom(i+5) , data_mom(i+5) );
    else
        fprintf(FID, '%s & %1.3f  & %1.3f & %s & %s & %s  & %s \\\\ \n', ...
            char(label_param{ind_label}),  sim_mom(i) , data_mom(i) , '' , '' ,  '' , '' );
    end
    ind_label = ind_label + 1;

end
fprintf(FID, ' \\hline \\\\ \n ');
fprintf(FID, '%s & %1.3f  & %1.3f  & %s  & %s & %s  & %s \\\\ \n', ...
    'Mean Child Skills (Grade 9)',  sim_mom(22) , data_mom(22) ,  '' , '' ,  '' , '' );
fprintf(FID, '%s & %1.3f  & %1.3f  & %s  & %s & %s  & %s \\\\ \n', ...
    'Mean Child Skills (Grade 10)',  sim_mom(23) , data_mom(23) ,  '' , '' ,  '' , '' );
fprintf(FID, '%s & %1.3f  & %1.3f  & %s  & %s & %s  & %s \\\\ \n', ...
    'Mean Child Skills (Grade 11)',  sim_mom(24) , data_mom(24) , '' , '' ,  '' , '' );
fprintf(FID, '%s & %1.3f  & %1.3f  & %s  & %s & %s  & %s \\\\ \n', ...
    'Mean Child Skills (Grade 12)',  sim_mom(25) , data_mom(25) ,  '' , '' ,  '' , '' );
fprintf(FID, '  \\hline \\hline \n');
fprintf(FID, '\\end{tabular}\n');
fclose(FID);


%%%%%%%%%%%%%%%%%%%%;
%Table D-3 (Next Period Peers);
%%%%%%%%%%%%%%%%%%%%;

FID = fopen('Table_Fit3.tex', 'w');
fprintf(FID, '\\begin{tabular}{lcc cc cc }\\hline \\hline  \n');
fprintf(FID, ' & \\multicolumn{6}{c}{Next Period Peers Skills} \\\\  & \\multicolumn{2}{c}{ Pooled Sample }  &   \\multicolumn{2}{c}{ Authoritarian = 0 }  & \\multicolumn{2}{c}{ Authoritarian = 1 }  \\\\ \\cline{2-3} \\cline{4-5} \\cline{6-7} \\\\ \n');
fprintf(FID, '   &  (1) & (2)  &  (3) & (4) &  (5) & (6) \\\\ \n ');
fprintf(FID, '   &  Model & Data &  Model & Data &  Model & Data \\\\ \\hline \\\\ \n ');

ind_label = 1;

for i = 11:13
    if i < 13
        fprintf(FID, '%s & %1.3f  & %1.3f & %1.3f  & %1.3f & %1.3f  & %1.3f \\\\ \n', ...
            char(label_param{ind_label}),  sim_mom(i) , data_mom(i) , sim_mom(i+3) , data_mom(i+3) ,  sim_mom(i+5) , data_mom(i+5) );
    else
        fprintf(FID, '%s & %1.3f  & %1.3f & %s & %s & %s  & %s \\\\ \n', ...
            char(label_param{ind_label}),  sim_mom(i) , data_mom(i) , '' , '' ,  '' , '' );
    end
    ind_label = ind_label + 1;

end
fprintf(FID, ' \\hline \\\\ \n ');
fprintf(FID, '%s & %1.3f  & %1.3f & %s & %s & %s  & %s \\\\ \n', ...
    'Mean Number of Friends',  sim_mom(28) , data_mom(28) , '' , '' ,  '' , '' );

fprintf(FID, '  \\hline \\hline \n');
fprintf(FID, '\\end{tabular}\n');
fclose(FID);


%%%%%%%%%%%%%%%%%%%%;
%Table D-4 (Parental Investments by PS);
%%%%%%%%%%%%%%%%%%%%;

%Table 4
FID = fopen('Table_Fit4.tex', 'w');
fprintf(FID, '\\begin{tabular}{lcccc}\\hline \\hline  \n');
fprintf(FID, ' & \\multicolumn{4}{c}{\\shortstack{Parantal Investments}  } \\\\     &   \\multicolumn{2}{c}{ Authoritarian = 0 }  & \\multicolumn{2}{c}{ Authoritarian = 1 }  \\\\ \\cline{2-3} \\cline{4-5} \\\\ \n');
fprintf(FID, '   &  (1) & (2) & (3) & (4) \\\\ \n ');

fprintf(FID, '   &  Model &  Data & Model & Data \\\\ \\hline \\\\ \n ');

ind_label = 1;
for i = 18:19

    fprintf(FID, '%s & %1.3f  & %1.3f & %1.3f  & %1.3f \\\\ \n', ...
        char(label_param{ind_label}),  sim_mom(i) , data_mom(i) , sim_mom(i+2) , data_mom(i+2) );

    ind_label = ind_label + 1;

end
fprintf(FID, ' \\hline \\\\ \n ');
fprintf(FID, '%s & %1.3f  & %1.3f  & %1.3f  & %1.3f \\\\ \n', ...
    'Mean Dep. Variable',  sim_mom(26) , data_mom(26) ,   sim_mom(27) , data_mom(27)  );
fprintf(FID, '  \\hline \\hline \n');
fprintf(FID, '\\end{tabular}\n');
fclose(FID);

%%%%%%%%%%%%%%%%%%%%;
%Table D-5: Longitudinal PS;
%%%%%%%%%%%%%%%%%%%%;


label_param{1}=uint16('Change in Child`s Skills');
label_param{2}=uint16('Change in Peer Skills');

FID = fopen('Table_Fit5.tex', 'w');
fprintf(FID, '\\begin{tabular}{lcc}\\hline \\hline   \n');
fprintf(FID, ' & \\multicolumn{2}{c}{ Change in Authoritarian Style} \\\\ \\cline{2-3} \n');
fprintf(FID, '   &  (1) & (2)  \\\\ \n ');
fprintf(FID, '   &  Model & Data  \\\\ \\hline \\\\ \n ');

ind_label = 2;
for i = 30:-1:29

    fprintf(FID, '%s & %1.3f  & %1.3f  \\\\  \n', ...
        char(label_param{ind_label}),  sim_mom(i) , data_mom(i)  );

    ind_label = ind_label - 1;

end
fprintf(FID, '  \\hline \\\\ \n');


fprintf(FID, ' & \\multicolumn{2}{c}{ Change in Parental Investments} \\\\ \\cline{2-3} \\\\ \n');


ind_label = 2 ;
label_param{1}=uint16('Intercept');
label_param{2}=uint16('Authoritarian (t-1)');

for i = 32:-1:31

    fprintf(FID, '%s & %1.3f  & %1.3f  \\\\  \n', ...
        char(label_param{ind_label}),  sim_mom(i) , data_mom(i)  );

    ind_label = ind_label - 1 ;
end

fprintf(FID, '  \\hline \\hline \n');
fprintf(FID, '\\end{tabular}\n');
fclose(FID);




cd(fp.matlab)
    
end